package day12;

/**
 * @author oldliu
 * @since 1.0
 */
public class Accout {
    private String acno;//账号
    private int money;//余额

    public Accout(String acno, int money) {
        this.acno = acno;
        this.money = money;
    }
    //存钱
    public void deposit(int m){
        this.money+=m;
    }

    //取钱
    public boolean withDraw(int m) {
        this.money -= m;
        return true;
//        if (money >= m)
//        {
//
//            try {
//                Thread.sleep((long) (50*Math.random()));
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
//            return  true;
//        }
//        else
//            System.out.println(this.acno + "余额不足");
//
//        return  false;
    }

    public String getAcno() {
        return this.acno;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }
}
